module.exports = {
	/**
	 * 查询多条记录 分页
	 * @url template/list/pub/getList 前端调用的url参数地址
	 * data 请求参数 说明
	 * @params {Number}         pageIndex 当前页码
	 * @params {Number}         pageSize  每页显示数量
	 * @params {Array<Object>}  sortRule  排序规则
	 * @params {object}         formData  查询条件数据源
	 * @params {Array<Object>}  columns   查询条件规则
	 * res 返回参数说明
	 * @params {Number}         code      错误码，0表示成功
	 * @params {String}         msg       详细信息
	 */
	main: async (event) => {
		let { data = {}, userInfo, util, filterResponse, originalParam } = event;
		let { customUtil, uniID, config, pubFun, vk, db, _ } = util;
		let { uid } = data;
		let res = { code: 0, msg: '' };
		// 业务逻辑开始-----------------------------------------------------------

		let dbName = "vk-test";
		res = await vk.baseDao.getTableData({
			dbName,
			data
		});

		let avatar = "https://vkceyugu.cdn.bspapp.com/VKCEYUGU-cf0c5e69-620c-4f3c-84ab-f4619262939f/22f32367-f4a3-41c6-a4b6-975bf2c99827.png";
		res.rows = [
			{
				_id: "1",
				_add_time: 1645410287983,
				nickname: "a",
				avatar,
				value: 10000,
				balance:10000,
				title:"充值",
				type:1,
				goods_list:[
					{
							"sku_id": "001",
							"goods_name": "商品名称商品名称商品",
							"sku_name": "商品名称商品名称",
							"price": 59900,
							"image": "https://img.alicdn.com/imgextra/i1/121022687/O1CN01xowpQk1VigvH5vZVp_!!121022687.jpg",
							"buy_num": 1,
					},
					{
							"sku_id": "003",
							"goods_name": "商品名称商品名称商品名称商品名称商品名称商品名称商品名称商品名称商品名称商品名称商品名称商品名称1",
							"sku_name": "100kg",
							"price": 59900,
							"image": "https://img.alicdn.com/imgextra/i1/121022687/O1CN01xowpQk1VigvH5vZVp_!!121022687.jpg",
							"buy_num": 3,
					}
				]
			},
			{
				_id: "2",
				_add_time: 1645410000000,
				nickname: "君不见，黄河之水天上来，奔流到海不复回。君不见，高堂明镜悲白发，朝如青丝暮成雪。",
				avatar,
				value: -10000,
				balance:0,
				title:"消费",
				type:2,
				goods_list:[
					{
							"sku_id": "001",
							"goods_name": "商品名称商品名称商品",
							"sku_name": "商品名称商品名称",
							"price": 59900,
							"image": "https://img.alicdn.com/imgextra/i1/121022687/O1CN01xowpQk1VigvH5vZVp_!!121022687.jpg",
							"buy_num": 1,
					}
				]
			}
		];

		// 业务逻辑结束-----------------------------------------------------------
		return res;
	}

}
